package com.hzsoft.sys.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.hzsoft.sys.entity.TblQuestionBank;
import com.hzsoft.sys.entity.TblTestTemp;
import com.hzsoft.sys.mapper.TblTestTempMapper;
import com.hzsoft.sys.service.TblTestTempService;

@Service("tblTestTempService")
public class TblTestTempServiceImpl implements TblTestTempService{
	
	private TblTestTempMapper tempMapper;
	
	public TblTestTempMapper getTempMapper() {
		return tempMapper;
	}
	@Autowired
	public void setTempMapper(TblTestTempMapper tempMapper) {
		this.tempMapper = tempMapper;
	}

	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return tempMapper.deleteByPrimaryKey(id);
	}

	public int insert(TblTestTemp record) {
		// TODO Auto-generated method stub
		return tempMapper.insert(record);
	}

	public int insertSelective(TblTestTemp record) {
		// TODO Auto-generated method stub
		return tempMapper.insertSelective(record);
	}

	public TblTestTemp selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return tempMapper.selectByPrimaryKey(id);
	}

	public int updateByPrimaryKeySelective(TblTestTemp record) {
		// TODO Auto-generated method stub
		return tempMapper.updateByPrimaryKeySelective(record);
	}

	public int updateByPrimaryKey(TblTestTemp record) {
		// TODO Auto-generated method stub
		return tempMapper.updateByPrimaryKey(record);
	}
	public int addTemp(List<TblTestTemp> templist) {
		int count = 0;		
		
		
		for (TblTestTemp tblTestTemp : templist) {
			System.out.println("---"+JSON.toJSONString(templist));
			
			count += tempMapper.insertSelective(tblTestTemp);;
		}
		return count;
	}
	public int updateByUserId(TblTestTemp test) {
		// TODO Auto-generated method stub
		return tempMapper.updateByUserId(test);
	}

}
